$.ajax({
    url: "/RuanJianKeShe/getAllCourseByTno",
    type: "post",
    data: {
        "msg":"getAllCourseByTno"
    },
    dataType: "json",
    success: function (data) {
        showAllCourseByTno(data.courseAndSum);

    },
    error: function () {
        alert("fail");
    }
})
function showAllCourseByTno(data) {
    var str = "";
    console.log(data);
    for (var i = 0; i < data.length; i++) {
        str = "<tr>" +
            "<td>" + data[i].cno +  "</td>" +
            "<td>" + data[i].cname + "</td>" +
            "<td>" + data[i].sum + "</td>" +
            "<td>" + "<button onclick=\"updateHandle("+data[i].cno+")\">修改</button>" +
            "</td><td></td>" +
            "</tr>";
        $("#tab").append(str);
    }
}
updateHandle = function (value) {
    window.location.href="findAllStuByCno.html?index="+value;
}